package 实验五;
import java.util.Scanner;
class work
{
	int a;
	int b;
	int max=0;
	void setA(int a)
    {  
      this.a=a;        //将参数a的值赋值给成员变量a
    }
    void setB(int b)
    {  
      this.b=b;       //将参数b的值赋值给成员变量b
    }
    int  getmin()
    {
    	if(a<b)
    	return a;
    	else
    	return b;
    }
    int zz()
    {
    	
    	for(int i=1;i<=getmin();i++)
    	{
    		if(a%i==0&&b%i==0)
    		{
    			if (i>max)
    			max=i;
    		}
    	}
    	return max;
    }
    void input()
    {
    	System.out.println("最大公约数是"+max);
    }
}
public class gongyueshu {
		public static void main(String argc[])
		{
			Scanner scanner = new Scanner(System.in);
			work gg =new work();
			gg.setA(scanner.nextInt());
			gg.setB(scanner.nextInt());
			gg.zz();
			gg.input();
		}
}
